package cloud.simple.ui.web;

import cloud.simple.ui.model.User;
import cloud.simple.ui.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 服务入口
 * Created by VIC on 2016/9/23.
 */
@RestController
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping(value = "/users")
    public ResponseEntity<List<User>> readUserInfo() {
        List<User> users = userService.searchAll();
        return new ResponseEntity<List<User>>(users, HttpStatus.OK);
    }
}
